package com.avic.modules.statistics.service.mapper;

import com.avic.common.mapper.CoreMapper;
import com.avic.modules.statistics.domain.MonthlyStatistics;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author zhangzikang
 * @date 2022-10-18
 */
@Repository
@Mapper
public interface MonthlyStatisticsMapper extends CoreMapper<MonthlyStatistics> {

    @Select("select id,equip_id,monthly_operation,monthly_manual,monthly_idle,monthly_alarm,monthly_shutdown," +
            "monthly_operation_time,monthly_manual_time,monthly_idle_time,monthly_alarm_time,monthly_shutdown_time from monthly_statistics where equip_id = #{equipId}")
    MonthlyStatistics selectEquipId(@Param("equipId")String equipId);

    @Delete("TRUNCATE TABLE monthly_statistics")
    void del();
}
